Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #pragma tabsize 0
- new idx;
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new tmp[254];
- new cmd[256];
- if(strcmp(cmd, "/godtest", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- new oyuncuID;
- oyuncuID = strval(tmp);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,-1, "/godtest [playerid]");
- return 1;
- }
- if (IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You'r not rcon admin..");
- else if(IsPlayerConnected(oyuncuID)) return SendClientMessage(playerid,-1,"Playerid is not connected.");
- godProtect(oyuncuID);
- return 1;
- }
- return 0;
- }
- stock godProtect(playerid)
- {
- new Float:oyuncuCan;
- GetPlayerHealth(playerid,oyuncuCan);
- SetPlayerHealth(playerid,50);
- if(oyuncuCan != 50.0)
- {
- SendClientMessage(playerid,-1,"You is god! KİCK!");
- Kick(playerid);
- return 0;
- }
- return 1;
- }
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement