[Comenzi] Cuff si Uncuff ( Anim + Object 0.3e )
:: Diverse :: San Andreas Multiplayer :: ScriptFiles
Pagina 1 din 1
[Comenzi] Cuff si Uncuff ( Anim + Object 0.3e )
Am vazut ca foarta multa lume cauta aceste comenzi,cu animul si obiectul adaugat in 0.3e.
Comanda cuff:
Comanda uncuff:
Adaugati:
OnPlayerConnect:
Callback IsACop
Comanda cuff:
- Cod:
if(strcmp(cmd, "/cuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [Playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " You can't Cuff Cops !");
return 1;
}
if(PlayerCuffed[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " Player already Cuffed !");
return 1;
}
if (ProxDetectorS(3.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Cuff yourself!"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ti-a pus catusele pe maini, nu mai poti pelca nicaieri.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* I-ai pus catusile lui %s, sa nu mai poata pleca nicaieri.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s i-a pus catusile lui %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
TogglePlayerControllable(giveplayerid, 0);
SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_CUFFED);
PlayerCuffed[giveplayerid] = 2;
PlayerCuffedTime[giveplayerid] = 180;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Acest player nu este langa tine !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Acest player este Offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nu esti Cop / S.W.A.T / National Guard !");
}
}
return 1;
}
Comanda uncuff:
- Cod:
if(strcmp(cmd, "/uncuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /uncuff [Playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(3.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Uncuff yourself!"); return 1; }
if(PlayerCuffed[giveplayerid])
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ti-a dat catusile jos.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* I-ai dat catusile jos lui %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
for(new i;i<10;i++) RemovePlayerAttachedObject(giveplayerid,i);
SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
TogglePlayerControllable(giveplayerid, 1);
PlayerCuffed[giveplayerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player isn't Tied up !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Acest player nu este langa tine !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Acest player este Offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nu esti Cop / S.W.A.T / National Guard !");
}
}//not connected
return 1;
}
Adaugati:
- Cod:
forward IsACop(playerid);
new PlayerCuffed[MAX_PLAYERS];
new PlayerCuffedTime[MAX_PLAYERS];
OnPlayerConnect:
- Cod:
PlayerCuffed[playerid] = 0;
PlayerCuffedTime[playerid] = 0;
Callback IsACop
- Cod:
public IsACop(playerid)
{
if(IsPlayerConnected(playerid))
{
new leader = PlayerInfo[playerid][pLeader];
new member = PlayerInfo[playerid][pMember];
if(member==1 || member==2 || member==3)
{
return 1;
}
else if(leader==1 || leader==2 || leader==3)
{
return 1;
}
}
return 0;
}
R3ALL- Membru, skill +9
- Mesaje : 479
Data de inscriere : 28/08/2012
Varsta : 27
Localizare : Bucuresti
:: Diverse :: San Andreas Multiplayer :: ScriptFiles
Pagina 1 din 1
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum
|
|