Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- new tmp[256];
- new idx;
- if(IsPlayerAdmin(playerid)){ //START_ADMIN
- //RESTART_GAME
- if(strcmp("/newgame", cmdtext, true) == 0)
- {
- new i;
- for(i=0;i<MAX_VEHICLES;i++){
- if(GetVehicleModel(i)==451){
- DestroyVehicle(i);
- }
- if(GetVehicleModel(i)==596){
- DestroyVehicle(i);
- }
- if(GetVehicleModel(i)==427){
- DestroyVehicle(i);
- }
- }
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_robbers1.txt");
- SendClientMessageToAll(COLOR_BLUE,"[NEW GAME]: A new game is about to start.");
- for(i=0;i<MAX_PLAYERS;i++){
- ForceClassSelection(i);
- SetPlayerHealth(i,0);
- return 1;
- }
- SendClientMessageToAll(COLOR_BLUE,"[NEW GAME]: A new game has started.");
- }
- //NEW_ROUND
- if(strcmp("/newround", cmdtext, true) == 0)
- {
- new i;
- for(i=0;i<MAX_VEHICLES;i++){
- if(GetVehicleModel(i)==451){
- DestroyVehicle(i);
- }
- if(GetVehicleModel(i)==596){
- DestroyVehicle(i);
- }
- if(GetVehicleModel(i)==427){
- DestroyVehicle(i);
- }
- }
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_robbers1.txt");
- SendClientMessageToAll(COLOR_BLUE,"[NEW ROUND]: A new round is about to start.");
- for(i=0;i<MAX_PLAYERS;i++){
- SetPlayerHealth(i,0);
- }
- SendClientMessageToAll(COLOR_BLUE,"[NEW ROUND]: A new round has started.");
- return 1;
- }
- //TEAM_SWAP
- if(strcmp("/teamswap", cmdtext, true) == 0)
- {
- new i;
- for(i=0;i<MAX_VEHICLES;i++){
- if(GetVehicleModel(i)==451){
- DestroyVehicle(i);
- }
- if(GetVehicleModel(i)==596){
- DestroyVehicle(i);
- }
- if(GetVehicleModel(i)==427){
- DestroyVehicle(i);
- }
- }
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_robbers1.txt");
- SendClientMessageToAll(COLOR_BLUE,"[TEAM SWAP]: Teams are getting swapped.");
- for(i=0;i<MAX_PLAYERS;i++){
- if(GetPlayerTeam(i)==0){SetSpawnInfo(i,1,280,1543.3428,-1610.6449,13.3828,269.6727,24,300,31,600,3,1);
- }
- if(GetPlayerTeam(i)==1){SetSpawnInfo(i,0,126,2229.3640,1805.3900,10.6541,90.7541,23,300,29,600,5,1);
- }
- SetPlayerHealth(i,0);
- }
- SendClientMessageToAll(COLOR_BLUE,"[TEAM SWAP]: Team have been swapped.");
- return 1;
- }
- //RELOAD_GAMEMODE
- if(strcmp("/reload", cmdtext, true) == 0)
- {
- SendRconCommand("gmx");
- return 1;
- }
- if(strcmp(cmd, "/kick", true) == 0)
- {
- new tmp[128];
- tmp = strtok(cmdtext, idx);
- if(strlen(tmp) == 0) return SendClientMessage(playerid,COLOR_RED, "USAGE: /kick [playerid]");
- Kick(strval(tmp));
- return 1;
- }
- if(strcmp(cmd, "/ban", true) == 0)
- {
- new tmp[128];
- tmp = strtok(cmdtext, idx);
- if(strlen(tmp) == 0) return SendClientMessage(playerid,COLOR_RED, "USAGE: /ban [playerid]");
- Ban(strval(tmp));
- return 1;
- }
- if(strcmp( cmd, "/goto", true ) == 0)
- {
- new tmp[256];
- tmp = strtok(cmdtext,idx);
- if(!strlen(tmp)) { return 1; }
- new Float:X, Float:Y, Float:Z;
- if(GetPlayerVehicleID(playerid))
- {
- GetPlayerPos( strval(tmp), X, Y, Z );
- SetVehiclePos( GetPlayerVehicleID(playerid), X+2, Y+2, Z );
- SendDeathMessage(playerid,strval(tmp,WEAPON_VEHICLE));
- } else {
- GetPlayerPos( strval(tmp), X, Y, Z );
- SetPlayerPos( playerid, X+2, Y+2, Z );
- SendDeathMessage(playerid,strval(tmp,WEAPON_VEHICLE));
- }
- return 1;
- }
- if(strcmp(cmd, "/bring", true) == 0)
- {
- new tmp[256];
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) { return 1; }
- new Float:X, Float:Y, Float:Z;
- if(GetPlayerVehicleID(strval(tmp)))
- {
- GetPlayerPos(playerid, X, Y, Z);
- SetVehiclePos(GetPlayerVehicleID(strval(tmp)), X+2, Y+2, Z);
- SendDeathMessage(strval(tmp,playerid,WEAPON_VEHICLE));
- } else {
- GetPlayerPos(playerid, X, Y, Z);
- SetPlayerPos(strval(tmp), X+2, Y+2, Z);
- SendDeathMessage(strval(tmp,playerid,WEAPON_VEHICLE));
- }
- return 1;
- }
- } //END_ADMIN
- else{
- return SendClientMessage(playerid,COLOR_RED,"You do not have the permissions for this command."); //ELSE_ADMIN
- }
- return SendClientMessage(playerid,COLOR_RED,"Command does not exist, or invalid syntax.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement