23.12.2009, 00:36
I have this command:
If I try that an error would appear, because id isn't a string:
How to make a variable, an interger and a string at the same time?
pawn Код:
CMD:p(playerid, params[])
{
new
id,
SubPar[24],
string[128];
if(PlayerInfo[playerid][Level] > 2)
{
if(sscanf(params, "u ", id))
{
if(strcmp(id, "help", true, 4)) // for /p help...
{
SendClientMessage(playerid, SYSTEM_INFO, "Usage: /p [id] [command].");
if(PlayerInfo[playerid][Level] == 3)
{
// p mods commands
}
else if(PlayerInfo[playerid][Level] == 4)
{
// p admins commands
}
else if(PlayerInfo[playerid][Level] == 5)
{
//p management commands
}
else if(PlayerInfo[playerid][Level] == MAX_LEVEL)
{
//p Owner only comands
}
}
else if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id))
{
SendClientMessage(playerid, SYSTEM_DENIAL, "Error: Invalid player ID.");
}
}
}
else
{
//non admins message
}
return 1;
}
pawn Код:
if(strcmp(id, "help", true, 4)) // for /p help...
{
//help message
}