//taken from y_utils - a part of the YSI package by ******
#if !defined isnull
#define isnull(%1) \
((%1[0] == 0) || (%1[0] == 1 && %1[1] == 0))
#endif
Hi, I'm looking for the command /teleportto [id] to teleport to a player being rcon logged in. Please don't use scanff, thank you.
|
Hi, I'm looking for the command /teleportto [id] to teleport to a player being rcon logged in. Please don't use scanff, thank you.
|
CMD:teleportto(playerid, params[])
{
if( !IsPlayerAdmin( playerid ))
return SendClientMessage( playerid, 0xFF0000FF, "[ERROR] Only RCON admins can use this command." );
if( isnull( params ))
return SendClientMessage( playerid, 0xFFFF00FF, "[USAGE] /teleport [target id] - teleports you to the player." );
new
iTarget = strval( params ),
Float: fPos[ 3 ]
;
GetPlayerPos( iTarget, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
SetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
SendClientMessage( playerid, 0x00FF00FF, "[SUCCESS] You've been teleported to the specified player" );
return true;
}
if( !strcmp( cmdtext, "/teleportto", true ))
{
if( !IsPlayerAdmin( playerid ))
return SendClientMessage( playerid, 0xFF0000FF, "[ERROR] Only RCON admins can use this command." );
stock const
params[ 116 ] = cmdtext[ 12 ]
;
if( isnull( params ))
return SendClientMessage( playerid, 0xFFFF00FF, "[USAGE] /teleport [target id] - teleports you to the player." );
new
iTarget = strval( params ),
Float: fPos[ 3 ]
;
GetPlayerPos( iTarget, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
SetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] );
SendClientMessage( playerid, 0x00FF00FF, "[SUCCESS] You've been teleported to the specified player" );
return true;
}
//taken from y_utils - a part of the YSI package by ******
#if !defined isnull
#define isnull(%1) \
((%1[0] == 0) || (%1[0] == 1 && %1[1] == 0))
#endif
All's good but one error :S
C:\Users\ilmar\Desktop\Nebuloss Fun\gamemodes\NF-1.pwn(3527) : error 033: array must be indexed (variable "g_iPlayersInVehicle") |
if( iVehicle == g_iSpawnedVehicles[ i ] && g_iPlayersInVehicle < 1 )
if( iVehicle == g_iSpawnedVehicles[ i ] && g_iPlayersInVehicle[ i ] < 1 )
Ah yes, my bad. Change this line:
pawn Code:
pawn Code:
|
CMD:dance(playerid, params[])
{
new anim;
if(sscanf(params, "i", anim)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dance [1-4]");
if(anim < 1 || anim > 4) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dance [1-4]");
switch(anim)
{
case 1: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE1);
case 2: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE2);
case 3: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE3);
case 4: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE4);
}
SetPlayerChatBubble(playerid,"Starts Dancing",0xFFFFFFF,30.0,2500);
return 1;
}
CustomMods[v] = CreateObject(modelid,0.0,0.0,0.0,0.0,0.0,0.0);
AttachObjectToVehicle(CustomMods[v], v, 0.0,0.0,0.0,0.0,0.0,0.0);
EditObject(playerid, CustomMods[v]);
Hey All, I want to edit vehicle object with 0.3e, Is it posibble to do this ?
pawn Code:
|
new
pMapperLevel[MAX_PLAYERS] = 0
;
CMD:makemapper(playerid, params[])
{
new iID, iLevel;
// add your IsPlayerAdmin < 4 here
if(sscanf(params, "ud", iID, iLevel))
return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /makemapper [nick/id] [reason]");
if(iLevel < 1 || iLevel > 4)
return SendClientMessage(playerid, COLOR_RED, "Invalid level specified. Valid level's are 1 through 4.");
new szString[128];
format(szString, sizeof(szString), "%s has set your mapper level to %d.", getName(playerid), iLevel);
SendClientMessage(iID, COLOR_GREEN, szString);
format(szString, sizeof(szString), "You have set %s's mapper level to %d.", getName(iID), iLevel);
SendClientMessage(playerid, COLOR_RED, szString);
pMapperLevel[iID] = iLevel;
return 1;
}
stock getName(playerid)
{
new szName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szName, sizeof(szName));
return szName;
}
CMD:mc(playerid, params[])
{
if(isnull(params))
return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /mc [message]");
if(pMapperLevel[playerid] < 1)
return 1;
new szString[128];
format(szString, sizeof(szString), "Mappers Chat - %s: %s", getName(playerid), params);
foreach(new i : Player)
{
if(pMapperLevel[i] > 0)
{
SendClientMessage(i, COLOR_BLUE, szString);
}
}
return 1;
}
CMD:createobject(playerid, params[])
{
if(isnull(params))
return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /createobject [object id]");
if(!IsNumeric(params))
return SendClientMessage(playerid, COLOR_RED, "ERROR: Object ID's must be numerical!");
new Float:fPos[3];
GetPlayerPos(playerid, fPos[0], fPos[1], fPos[2]);
new object = CreateObject(strval(params), fPos[0], fPos[1], fPos[2], -1, -1, -1);
EditObject(playerid, object);
return 1;
}
/dance 1-3 with ZCMD. I know how to make the animation, but don't know how to make the /dance 1, /dance 2, /dance 3.
|
CMD:dance(playerid, params[])
{
new style;
if(sscanf(params, "d", style)) return SendClientMessage(playerid, 0xFF000000, "USAGE: /dance (style 1-4)");
if(style < 1 || style > 4) return SendClientMessage(playerid, 0xFF000000, "Invalid dance style.");
if(style == 1) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE1);
if(style == 2) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE2);
if(style == 3) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE3);
if(style == 4) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE4);
return 1;
}