SA-MP Forums Archive
This did not work idk why? Need help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: This did not work idk why? Need help (/showthread.php?tid=308302)



This did not work idk why? Need help - Gravity4501 - 03.01.2012

new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if (strcmp("/makeadmin", cmdtext, true, 10) == 0)
new string[128];
new tmp[256];
new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if (IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, ORANGE, "USAGE: /makeadmin [playerid] [level]");
SendClientMessage(playerid, ORANGE, "FUNCTION: Player will be an admin.");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new level = strval(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
PlayerInfo[giveplayerid][AdminLevel] = level;
printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level, player);
SendClientMessage(giveplayerid, 0x00C2ECFF, string);
format(string, sizeof(string), "You have given %s level %d admin.", giveplayer,PlayerInfo[giveplayerid][AdminLevel]);
SendClientMessage(playerid, 0x00C2ECFF, string);
}
else if(giveplayerid == INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%i is not an active player.", giveplayerid);
SendClientMessage(playerid, 0xE60000FF, string);
}


Re: This did not work idk why? Need help - Spooky - 03.01.2012

Use
[pawn] for the .pwn codes.


Re: This did not work idk why? Need help - Gravity4501 - 03.01.2012

Quote:
Originally Posted by Spooky
Посмотреть сообщение
Use
[pawn] for the .pwn codes.
Were i can't find it in my files


Re: This did not work idk why? Need help - Spooky - 03.01.2012

Dude i mean on forums
type
[pawn]
//your code here.
and /pawn bbcode


Re: This did not work idk why? Need help - eDz0r - 03.01.2012

use zcmd + sscanf


Re: This did not work idk why? Need help - Gravity4501 - 03.01.2012

Quote:
Originally Posted by eDz0r
Посмотреть сообщение
use zcmd + sscanf
I fk don't get it