16.08.2010, 23:22
The problem is i dont know how to convert command from strcmp / strotk to ZCMD / sscanf
here is command
I dont know how to make IN ZCMD when you type /v parkiraj to work but point is i have alot of this shit
If you dont understand what i trying to say then ask what you didnt understand
So i just need with ONE ZCMD command ( /v ) to can call this all SUB commands like
[ /v lock ]
[ /v parkiraj ] etc etc
here is command
pawn Код:
if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new x_nr[512];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SCM(playerid, COLOR_LIGHTBLUE, "Koristenje: /v [ime]");
SCM(playerid, 0x83BFBFAA, "Moguca imena: parkiraj, lock, unlock, prodaj, lociraj, gpsoff");
return 1;
}
if(strcmp(x_nr,"parkiraj",true) == 0)
{
if(IsPlayerConnected(playerid))
{
new skljuc = GetMojMotor(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if( PlayerInfo[playerid][pMotoKey] == 999)
{
SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo!");
return 1;
}
if(PlayerInfo[playerid][pMotoKey] != 999)
{
for(new i = 0; i < sizeof(Motori); i++)
{
if(vehicleid == Motori[i][mOsobno])
{
if(skljuc == i)
{
new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
Motori[i][mX] = x;
Motori[i][mY] = y;
Motori[i][mZ] = z;
Motori[i][mA] = a;
DestroyVehicle(vehicleid);
CreateVehicle(Motori[i][mModel],Motori[i][mX],Motori[i][mY],Motori[i][mZ],Motori[i][mA],Motori[i][mpBoja],Motori[i][mdBoja],30000);
PutPlayerInVehicle(playerid, vehicleid, 0);
SCM(playerid, COLOR_GREEN, "parkirano!");
UpdateMotor(i);
return 1;
}
else
{
SCM(playerid, COLOR_LIGHTRED,"Niste na svom vozilu!");
return 1;
}
}
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Nemate vozilo!");
}
}
else
{
SCM(playerid, COLOR_LIGHTRED, "Morate biti u svom vozilu da bi ga parkirali!!");
}
}
return 1;
}
else if(strcmp(x_nr,"lock",true) == 0)
{
new skljuc = GetMojMotor(playerid);
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMotoKey] == 999)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!!");
return 1;
}
if(PlayerInfo[playerid][pMotoKey] != 999)
{
format(string, sizeof(string), "Vozilo zakljucano!");
SCM(playerid,COLOR_LIGHTRED,string);
Motori[skljuc][mZakljucan] = 1;
UpdateMotor(skljuc);
return 1;
}
}
return 1;
}
pawn Код:
else if(strcmp(x_nr,"unlock",true) == 0)
{
new skljuc = GetMojMotor(playerid);
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMotoKey] == 999)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Nemas vozilo!!");
return 1;
}
if(PlayerInfo[playerid][pMotoKey] != 999)
{
format(string, sizeof(string), "Vozilo otkljucano!");
SCM(playerid,COLOR_LIGHTGREEN,string);
Motori[skljuc][mZakljucan] = 0;
UpdateMotor(skljuc);
return 1;
}
}
return 1;
}
So i just need with ONE ZCMD command ( /v ) to can call this all SUB commands like
[ /v lock ]
[ /v parkiraj ] etc etc