Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new enum zaide
- {
- Admin
- }
- new zaidimoDB[MAX_PLAYERS][zaide];
- public OnPlayerCommandPerformed(playerid, cmdtext[], success )
- {
- if(!strcmp(cmdtext, "/get", true,4))
- {
- if(zaidimoDB[playerid][Admin])
- {
- if(cmdtext[4]==0){SendClientMessage(playerid, WHITE, "Atsiteleportuoti žaideja pas save: {FF0000}/get{00FF00} Dalis vardo"); return 1;} //Jeigu neteisingai parasai komanda
- new vardas[MAX_PLAYER_NAME]; //sukuria new'a
- strmid(vardas,cmdtext[5],0,MAX_PLAYER_NAME);
- new id = GetPlayeridMid(vardas);
- if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, RED, "Tokio žaidejo nera"); return 1;} //Tikrina ar ira tas zaidejas serveryje
- if (playerDB[id][ikalintas]) {SendClientMessage(playerid, RED, "Žaidejas kalejime"); return 1;} //tikrina ar zaidejas kaleime, jei taip tai jis negales /get
- playerDB[id][rid][0]=playerid;
- GetPlayerName(playerid,vardas,MAX_PLAYER_NAME);
- new msg[128]; format(msg, sizeof(msg), "{00FF00}Zaidejas {FF0000}%s {00FF00}tau siulo buti perkeltam pas ji\nAr sutinki?",vardas);
- ShowPlayerDialog(id,500,DIALOG_STYLE_MSGBOX,vardas , msg,"Sutikti","Nesutikti"); //Ismeta gui lentele su patvirtinimu
- }
- return 1;
- }
- if(strcmp("/ss", cmdtext, true, 10) == 0)
- {
- if(!zaidimoDB[playerid][Admin])
- {
- SendClientMessage(playerid,WHITE,"Jūs ne admin!");
- return 1;
- }
- if(cmdtext[3] == 0)
- {
- SendClientMessage(playerid,WHITE,"Irašykite tekstą /ss tekstas");
- return 1;
- }
- new file[128];
- format(file,sizeof(file),"Administratorius %s : %s " cmdtext);
- SendClientMessageToAll(WHITE,file);
- return 1;
- }
- if(!strcmp(cmdtext, "/heal", true,5))
- {
- if(!zaidimoDB[playerid][Admin])
- {
- SendClientMessage(playerid,WHITE,"Jūs ne admin!");
- return 1;
- }
- if(cmdtext[5]==0){SendClientMessage(playerid, COLOR, "* Pagydyti zaideja: /heal [dalis vardo]"); return 1;}
- new vardas[MAX_PLAYER_NAME];
- strmid(vardas,cmdtext[6],0,MAX_PLAYER_NAME);
- new id = GetPlayeridMid(vardas);
- if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, COLOR, "* Tokio zaidejo nera"); return 1;}
- new mess[256],name[MAX_PLAYER_NAME],rec[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- GetPlayerName(id,rec,sizeof(rec));
- format(mess,sizeof(mess),"***%s pagyde jus!",name);
- SendClientMessage(id,COLOR,mess);
- format(mess,sizeof(mess),"***Pagydete %s!",rec);
- SendClientMessage(playerid,COLOR,mess);
- SetPlayerHealth(id,100);
- SetPlayerArmour(id,100);
- return 1;
- }
- if(!strcmp(cmdtext, "/kill", true,5))
- {
- if(!zaidimoDB[playerid][Admin])
- {
- SendClientMessage(playerid,WHITE,"Jūs ne admin!");
- return 1;
- }
- if(cmdtext[5]==0){SendClientMessage(playerid, COLOR, "* Nuzudyti zaideja: /kill [dalis vardo]"); return 1;}
- new vardas[MAX_PLAYER_NAME];
- strmid(vardas,cmdtext[6],0,MAX_PLAYER_NAME);
- new id = GetPlayeridMid(vardas);
- if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, COLOR, "* Tokio zaidejo nera"); return 1;}
- new mess[256],rec[MAX_PLAYER_NAME];
- GetPlayerName(id,rec,sizeof(rec));
- format(mess,sizeof(mess),"***Nuzudete %s!",rec);
- SendClientMessage(playerid,COLOR,mess);
- SetPlayerHealth(id,0);
- return 1;
- }
- return 1;
- }
- if(!strcmp(cmdtext, "/to", true,3))
- {
- if(zaidimoDB[playerid][Admin])
- {
- if(cmdtext[3]==0){SendClientMessage(playerid, COLOR, "* Keliauti pas (be masinos): /to [dalis vardo]"); return 1;}
- new vardas[MAX_PLAYER_NAME];
- strmid(vardas,cmdtext[4],0,MAX_PLAYER_NAME);
- new id = GetPlayeridMid(vardas);
- if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, COLOR, "* Tokio zaidejo nera"); return 1;}
- if (GetPlayerVirtualWorld(id)>0){SendClientMessage(playerid, COLOR, "* Zaidejas savo namuose, isibrauti negrazu"); return 1;}
- SetPlayerInterior(playerid,GetPlayerInterior(id));
- new Float:tempcoo[3];
- GetPlayerPos(id,tempcoo[0],tempcoo[1],tempcoo[2]);
- SetPlayerPos(playerid,tempcoo[0],tempcoo[1],tempcoo[2]);
- SetCameraBehindPlayer(playerid);
- }
- return 1;
- }
- stock pName( playerid )
- {
- new
- Vardas[ 24 ]
- ;
- GetPlayerName( playerid, Vardas, 64 );
- return Vardas;
- }
Advertisement
Add Comment
Please, Sign In to add comment