Givegun - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Givegun (
/showthread.php?tid=151082)
Givegun -
Ihsan_Cingisiz - 29.05.2010
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;
}
Re: Givegun -
Think - 29.05.2010
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)
Re: Givegun -
(SF)Noobanatior - 29.05.2010
do you just want to give it to yourself?
Re: Givegun -
Ihsan_Cingisiz - 29.05.2010
Quote:
Originally Posted by (SF)Noobanatior
do you just want to give it to yourself?
|
Yes to my self
Re: Givegun -
(SF)Noobanatior - 29.05.2010
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) {
}