if (strcmp("/mypos", cmdtext, true, 10) == 0)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, COLOR_REDTRANS, "Displaying position... Loaded...");
format(string, sizeof(string), "Your position: %s, %s, %s.", x, y, z);
return 1;
}
|
C:\Users\James\Desktop\SAMP Server\gamemodes\ReelWurld.pwn(124) : error 017: undefined symbol "string" C:\Users\James\Desktop\SAMP Server\gamemodes\ReelWurld.pwn(124) : error 017: undefined symbol "string" C:\Users\James\Desktop\SAMP Server\gamemodes\ReelWurld.pwn(124) : error 029: invalid expression, assumed zero C:\Users\James\Desktop\SAMP Server\gamemodes\ReelWurld.pwn(124) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
if (strcmp("/mypos", cmdtext, true, 10) == 0)
{
new Float:x, Float:y, Float:z, string[128];
GetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, COLOR_REDTRANS, "Displaying position... Loaded...");
format(string, sizeof(string), "Your position: %f, %f, %f.", x, y, z);
SendClientMessage(playerid, COLOR_REDTRANS, string);
return 1;
}
//under
OnPlayerCommandText(playerid, cmdtext[])
new string[256];
//then your code here
if (strcmp("/mypos", cmdtext, true, 6) == 0) //should be 6 not 10
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, COLOR_REDTRANS, "Displaying position... Loaded...");
format(string, sizeof(string), "Your position: %s, %s, %s.", x, y, z);
SendClientMessage(playerid,COLOR_REDTRANS,string);
return 1;
}

|
Originally Posted by AF1-4-LIFE
Maybe you should make it like this:
Код:
//under
OnPlayerCommandText(playerid, cmdtext[])
new string[256];
//then your code here
if (strcmp("/mypos", cmdtext, true, 6) == 0) //should be 6 not 10
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, COLOR_REDTRANS, "Displaying position... Loaded...");
format(string, sizeof(string), "Your position: %s, %s, %s.", x, y, z);
SendClientMessage(playerid,COLOR_REDTRANS,string);
return 1;
}
![]() AF1 |
|
Originally Posted by Brendan_Thomson
Define string with a size of 128, NOT 256.
|
|
Originally Posted by radhakr
Quote:
|
cmd(mypos, playerid, params[])
{
new string[128], Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "* You are at: %f, %f, %f.");
SendClientMessage(playerid, COLOR, string);
return 1;
}
|
Originally Posted by Brendan_Thomson
Define string with a size of 128, NOT 256.
|
|
Originally Posted by Daren_Jacobson
Quote:
|