PDA

View Full Version : Help - cmdtext,idx


ongnung147
23/03/2017, 01:17 PM
CMD:SPP(playerid,params)
{
if(Player[playerid][pAdmin] < 2)
{
new Float:x1, Float:y1, Float:z1, Float:Ang;
new Array[7][128];
Array[0] = strtoko(cmdtext, idx, ',');
x1 = floatstr(Array[0]);
if(!strlen(Array[0]))
{
Array[1] = strtoko(cmdtext, idx, ',');
y1 = floatstr(Array[1]);
Array[2] = strtoko(cmdtext, idx, ',');
z1 = floatstr(Array[2]);
Array[3] = strtoko(cmdtext, idx, ',');
Ang = floatstr(Array[3]);
new tmpcar = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid) || gbug_PutPlayerInVehicle(playerid, tmpcar, 1))
{
SetVehiclePos(tmpcar,x1,y1,z1);
SetVehicleZAngle(tmpcar, Ang);
}
else
{
SetPlayerPos(playerid,x1,y1,z1);
SetPlayerFacingAngle(playerid, Ang);
}
new string[4];
format(string, sizeof(string), "{89ffe2}SetPos{ffffff}(%d, %.4f, %.4f, %.4f) - {89ffe2}SetAngle{ffffff}((%.4f)", playerid, x1, y1, z1, Ang);
SendClientMessage(playerid, COLOR_GREEN, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAYWHITE, " {ffffff}/SetPlayerPosEx {ffd1d2}[X],[Y],[Z]");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAYWHITE, " {ffffff}Ban khong phai admin");
}
return 1;
}

C:\Documents and Settings\Admin\My Documents\Downloads\123\gamemodes\dayz.pwn(3362) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Admin\My Documents\Downloads\123\gamemodes\dayz.pwn(3366) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Admin\My Documents\Downloads\123\gamemodes\dayz.pwn(3368) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Admin\My Documents\Downloads\123\gamemodes\dayz.pwn(3370) : error 017: undefined symbol "cmdtext"

ongnung147
23/03/2017, 02:59 PM
C:\Documents and Settings\Admin\Desktop\123\gamemodes\dayz.pwn(3350 ) : error 017: undefined symbol "GetPlayerNameEx"
C:\Documents and Settings\Admin\Desktop\123\gamemodes\dayz.pwn(3351 ) : warning 217: loose indentation
C:\Documents and Settings\Admin\Desktop\123\gamemodes\dayz.pwn(3351 ) : error 035: argument type mismatch (argument 2)

CMD:cc(playerid, params[])
{
if(Player[playerid][pAdmin] < 0)
{
for(new i = 0; i < 100; i++)
{
SendClientMessageToAll(-1, " ");
}
new string[128], giveplayerid;
format(string, sizeof(string), "[SYSTEM] %s da lam sach Chat Box. Thank You <3", GetPlayerNameEx(playerid));
SAM(giveplayerid, COLOR_LIGHTBLUE, string);
}
return 1;
}


Help

Toroi
23/03/2017, 03:19 PM
That's a good example for the why you should not just copy and paste into your gamemode, thanks.