25.04.2012, 05:14
Very good and useful rCmd
rCmd[sui]->ls(playerid, success, string[128], pName[MAX_PLAYER_NAME], veh)
{
if(!IsPlayerInAnyVehicle(playerid)){
SetPlayerPos(playerid, 1607.6703,-1721.9176,13.5469);
SetPlayerFacingAngle(playerid, 0.0);
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "{FF0000}(/ls) {FFFF00}Player {FF0000}%s {FFFF00}has Teleported to {FF0000}Los Santos",pName);
SetTimerEx("Unfreeze", 2000, 0, "d", playerid);
GameTextForPlayer(playerid,"~g~Waiting for the Objects to load",2000,3);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
else{
veh = GetPlayerVehicleID(playerid);
SetVehiclePos(veh, 1607.6703,-1721.9176,13.5469);
SetVehicleZAngle(veh, 0.0);
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "{FF0000}(/ls) {FFFF00}Player {FF0000}%s {FFFF00}has Teleported to {FF0000}Los Santos",pName);
SetTimerEx("Unfreeze", 2000, 0, "d", playerid);
SendClientMessageToAll(playerid, string);
GameTextForPlayer(playerid,"~g~Waiting for the Objects to load",2000,3);
LinkVehicleToInterior(veh, 0);
SetVehicleVirtualWorld(veh, 0);
PutPlayerInVehicle(playerid, veh, 0);
}
return SendClientMessage(playerid, 0xFF0000FF, "you have gone to Los Santos");
}
well, i agree to him, cuz i changed ALL my commands to rCmd but NONE of them work anymore, for example this one: if there is something wrong then please tell me cuz i really like this style it only doesnt works
pawn Код:
|
Using it for some days now, simply brilliant! Great work, keep it up ^^.
Also, like stated before, an 'optional' parameter would be great too. Edit: Possibly using INVALID_PLAYER_ID if the player entered a player ID that isn't connected? |
Very nice, only just saw this include. Excellent way of making commands. Takes the ache out of ball-ache!
If or when this is added i will be switching over to this completely. |
1- If you have any other command system, remove it.
2- Get a rid of OnPlayerCommandText. 3- Don't randomly add variables to the command parameters. 4- Don't use success if the command has no params. See example (/time) first post. 5- Specifier "u" does not return a string but an integer with the user ID. |
rCmd[]->kill(playerid)
{
SetPlayerHealth(playerid, 0.0);
return 1;
}