15.06.2013, 23:38
How can i set that i cant cuff a player if he doesn't have wanted level, and that i can't cuff him if he is not tased..
Here is my cuff command:
Here is command for check for taser: if(PlayerInfo[playerid][pTazovan] == 1)
And here is /su command ,pls just copy me here doned code and describe me what you do ,because im begginer,thanks alot :P
/SU
AND FOR END if u can say me how to make when player have wanted level ,his name is RED when you see him and on SCOREBOARD ,I hope you understand and help me ,thanks alot!
Here is my cuff command:
Код:
if(strcmp(cmd, "/cuff", true) == 0 || strcmp(cmd, "/stavilisice", true) == 0) { if(IsPlayerConnected(playerid)) { if(gTeam[playerid] == 2 || IsACop(playerid)) { if(KnockedDown[playerid] == 1) { SendClientMessage(playerid, COLOR_GREY, "Ne mozete zamahnuti kada ste vec oboreni."); return 1; } if(PlayerTied[playerid] == 1) { SendClientMessage(playerid, COLOR_GREY, " Vezani ste!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /stavilisice [ID Igraca/Dio Imena]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid)) { SendClientMessage(playerid, COLOR_GREY, " Ne mozete staviti lisice Policajcu!"); return 1; } if(PlayerCuffed[giveplayerid] > 1) { SendClientMessage(playerid, COLOR_GREY, " Igracu su vec stavljene lisice !"); return 1; } if (ProxDetectorS(3.0, playerid, giveplayerid)) { if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Ne mozete staviti lisice sebi!"); return 1; } { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* %s vam je stavio lisice.", sendername); SendClientMessage(giveplayerid, COLOR_WHITE, string); format(string, sizeof(string), "* Stavili ste lisice %s-u.", giveplayer); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "* %s stavlja lisice %s-u.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); GameTextForPlayer(giveplayerid, "~r~Stavljene su vam lisice", 2500, 3); TogglePlayerControllable(giveplayerid, 0); PlayerCuffed[giveplayerid] = 2; PlayerCuffedTime[giveplayerid] = 99999999999999; } } else { SendClientMessage(playerid, COLOR_GREY, " Taj igrac nije blizu vas !"); return 1; } } } else { SendClientMessage(playerid, COLOR_GREY, " Igrac je offline !"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " Niste Policajac / FBI / SWAT !"); } } return 1; }
And here is /su command ,pls just copy me here doned code and describe me what you do ,because im begginer,thanks alot :P
/SU
Код:
if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0) { if(IsPlayerConnected(playerid)) { if(OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 3 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 3) { } else { SendClientMessage(playerid, COLOR_GREY, " Niste na duznosti!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [opis zlocina]"); return 1; } giveplayerid = ReturnUser(tmp); if (gTeam[playerid] == 2 || IsACop(playerid)) { if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if (gTeam[giveplayerid] != 2) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [crime text]"); return 1; } if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; } else { WantedPoints[giveplayerid]+= 2; } SetPlayerCriminalEx(giveplayerid,playerid, result); return 1; } else { SendClientMessage(playerid, COLOR_GRAD2, " Ne mozete optuziti policajca !"); } } } else { format(string, sizeof(string), " %d nije aktivan igrac.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, " Niste Policajac / FBI / Swat !"); } } return 1; }