Givegun
#1

How can i give a player weapon
like

if (IsPlayerAdmin(playerid)) {
if (strcmp("/god", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 1000000000);
SetPlayerWeapon <----??
}
}
return 0;
}

And how can i already /kick and iD?

if (IsPlayerAdmin(playerid)) {
if (strcmp("/kick", cmdtext, true, 10) == 0)
{
I want to kick and ID here, but how?
}
}
return 0;
}


Reply
#2

You'll have to extract the ID from 'cmdtext' you can use strtok, sscanf or any other method you prefer. But you can also try another command processor like zcmd with the sscanf combo. (since it has its own params parameter)
Reply
#3

do you just want to give it to yourself?
Reply
#4

Quote:
Originally Posted by (SF)Noobanatior
do you just want to give it to yourself?
Yes to my self
Reply
#5

you want to add this into OnPlayerCommandText(...
and you will need to be rcon to use it
pawn Код:
if (IsPlayerAdmin(playerid)) {
   if (strcmp("/guns", cmdtext, true, 10) == 0)
   {
     GivePlayerWeapon(playerid, weaponid, ammo);
     return 1;
   }
   //next admin command if (strcmp("/guns", cmdtext, true, 10) == 0) {

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)