08.11.2014, 13:39
There's my command :
errors:
pawn Код:
if(strcmp(cmd, "/createteleport", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Administrator] < 3)
{
SendClientMessage(playerid, -1, "{FFFFFF}(( {FFCC00}Informatie -{C0C0C0} nu ai accces la aceasta comanda! {FFFFFF}))");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_YELLOW2, "{FFFFFF}(( {FFCC00}Exemplu folosire: {C0C0C0} /createteleport [nume] {FFFFFF}))");
return 1;
}
new string[456];
sTeleports ++;
new NEWTELEID = sTeleports;
new Float:x, Float:y, Float:z, Float:Angle,INT,VW;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, Angle);
VW = GetPlayerVirtualWorld(playerid);
INT = GetPlayerInterior(playerid);
format( string, sizeof( string ), "{FFFFFF}(( {FFCC00}Informatie - {C0C0C0} Am creat teleport( X: %f Y:%f Z:%f Angle: %f {FFFFFF}))", x,y,z,Angle);
SendClientMessage( playerid, -1, string);
TeleInfo[NEWTELEID][tX] = x;
TeleInfo[NEWTELEID][tY] = y;
TeleInfo[NEWTELEID][tZ] = z;
TeleInfo[NEWTELEID][tA] = Angle;
TeleInfo[NEWTELEID][tVW] = VW;
TeleInfo[NEWTELEID][tInt] = INT;
format(TeleInfo[NEWTELEID][tName], 32, "%s", (result));
szQuery[ 0 ] = EOS;
format( szQuery , 500 , "INSERT INTO `teleports` ( ID, Name, X, Y, Z, Angle, W , INT) VALUES ( %d, '%s',%f,%f,%f,%f,%d,%d )", NEWTELEID,TeleInfo[NEWTELEID][tName], TeleInfo[NEWTELEID][tX], TeleInfo[NEWTELEID][tY], TeleInfo[NEWTELEID][tZ], TeleInfo[NEWTELEID][tA], TeleInfo[NEWTELEID][tVW], TeleInfo[NEWTELEID][tInt] );
mysql_tquery( SQL , szQuery , "" , "" );
}
return 1;
}
errors:
