15.08.2012, 07:32
Quote:
CMDiren(playerid, params[]) { if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 || groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 2 || groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 4) { new string[128], type; new VID = GetPlayerVehicleID(playerid); if(sscanf(params, "d", type)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /siren [type]"); SendClientMessage(playerid, COLOR_GREY, "Type: 1 = Inside, 2 = Roof, 3 = Off."); return 1; } switch(type) { case 1: { if(Siren[VID] == 1) { SendClientMessage(playerid, COLOR_GREY, "This vehicle already has a siren!"); return 1; } Siren[VID] = 1; GetRPName(playerid, szPlayerName, MAX_PLAYER_NAME); SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0); AttachObjectToVehicle(SirenObject[VID], VID, 0.0, 0.75, 0.275, 0.0, 0.1, 0.0); format(string, sizeof(string), "* %s puts the siren on the dashboard.", szPlayerName); nearByMessage(playerid, COLOR_PURPLE, string); return 1; } case 2: { if(Siren[VID] == 1) { SendClientMessage(playerid, COLOR_GREY, "This vehicle already has a siren!"); return 1; } Siren[VID] = 1; GetRPName(playerid, szPlayerName, MAX_PLAYER_NAME); SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0); AttachObjectToVehicle(SirenObject[VID], VID, -0.43, 0.0, 0.785, 0.0, 0.1, 0.0); format(string, sizeof(string), "* %s puts the siren on the roof.", szPlayerName); nearByMessage(playerid, COLOR_PURPLE, string); return 1; } case 3: { if(Siren[VID] == 0) { SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't have a siren on it!"); return 1; } Siren[VID] = 0; GetRPName(playerid, szPlayerName, MAX_PLAYER_NAME); DestroyObject(SirenObject[VID]); format(string, sizeof(string), "* %s takes down the siren.", szPlayerName); nearByMessage(playerid, COLOR_PURPLE, string); return 1; } default: { SendClientMessage(playerid, COLOR_WHITE, "Invalid license type! /siren [type]"); SendClientMessage(playerid, COLOR_GREY, "Type: 1 = Roof, 2 = Inside, 3 = Off."); } } } else SendClientMessage(playerid, COLOR_GREY, "You're not authorised to use this command."); return 1; |
like this
Quote:
if(strcmp(cmd, "/cuff", true) == 0) { if(IsPlayerConnected(playerid)) { if(gTeam[playerid] == 2 || IsACop(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "» Scrie: /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, "{30a030}[GameFront]: {ffffff}Ne pare rau, dar nu poti utiliza aceasta comanda pe un Cop."); return 1; } if(PlayerCuffed[giveplayerid] > 0) { SendClientMessage(playerid, COLOR_GREY, "{30a030}[GameFront]: {ffffff}Ne pare rau, dar acest jucator are deja Cuff."); return 1; } if (ProxDetectorS(8.0, playerid, giveplayerid)) { new car = GetPlayerVehicleID(playerid); if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "{30a030}[GameFront]: {ffffff}Ne pare rau, dar nu poti utiliza aceasta comanda pe tine."); return 1; } if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2 && IsPlayerInVehicle(giveplayerid, car)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "» Ai primit Cuff de la %s.", sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "» I-ai dat Cuff lui %s.", giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "» %s i-a dat Cuff lui %s.", sendername ,giveplayer); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3); TogglePlayerControllable(giveplayerid, 0); PlayerCuffed[giveplayerid] = 2; PlayerCuffedTime[giveplayerid] = 180; } else { SendClientMessage(playerid, COLOR_GREY, "{30a030}[GameFront]: {ffffff}Ne pare rau, dar acest jucator nu este in Vehiculul tau."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "{30a030}[GameFront]: {ffffff}Ne pare rau, dar jucatorul nu este langa tine."); return 1; } } } else { SendClientMessage(playerid, COLOR_GREY, "{30a030}[GameFront]: {ffffff}Ne pare rau, dar acest jucator nu este Online."); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "{30a030}[GameFront]: {ffffff}Ne pare rau, dar nu faci parte din factiunea {3c54fc}PD{ffffff}, {3c54fc}NG {ffffff}sau {3c54fc}FBI{ffffff}."); } } return 1; } |