Question about string
#1

The command is for helper's to set people to the PD in LS .. but i dont know how you get "Helper "Name" has tped to you the police department?"


Quote:

command(pdhim, playerid, params[]) {
new string[128], playerid, pname[24];
format(string, sizeof(string), "HELPER %s teleported you to the police department LS", GetName(GetPlayerID(inputtext)));
SendClientMessage(playerid, RED, string);
if(Player[playerid][Tester] >= 1)
SetPlayerPos(playerid, 1551.8000488281, 1670.4000244141, );
SetPlayerInterior(playerid, SpawnInt);
SetPlayerVirtualWorld(playerid, 0);
}

and here is another one i don't get with string ! :


Quote:

CMD:fixvw(playerid, params[])
{
new string[128], playerid, pname[24];

GetPlayerName(playerid, pname, sizeof(pname));

if(Player[playerid][Tester] >= 1)
{
SetPlayerVirtualWorld(playerid, 0);
format(string, sizeof(string), "HELPER %s has fixed your virtual world", pname);
SendClientMessage(playerid, RED, string);
}
return 1;
}

This upper this one doen'st work and the string goed to the one who typed the command .. and the comamnd doesn't work anymore after i did that string !
Reply
#2

Quote:
Originally Posted by ikbenremco
Посмотреть сообщение
The command is for helper's to set people to the PD in LS .. but i dont know how you get "Helper "Name" has tped to you the police department?"




and here is another one i don't get with string ! :




This upper this one doen'st work and the string goed to the one who typed the command .. and the comamnd doesn't work anymore after i did that string !
pawn Код:
new pname[MAX_PLAYER_NAME];

GetPlayerName(/*helperid*/,pname,sizeof(pname));
Reply
#3

Quote:

command(pdhim, playerid, params[]) {
if(Player[playerid][Tester] >= 1)
new string[128], playerid, pname[24];
format(string, sizeof(string), "HELPER %s has fixed your virtual world",
GetPlayerName(Tester,pname,sizeof(pname));
SendClientMessage(playerid, RED, string);
if(Player[playerid][Tester] >= 1)
SetPlayerPos(playerid, 1551.8000488281, 1670.4000244141, 17);
SetPlayerInterior(playerid, SpawnInt);
SetPlayerVirtualWorld(playerid, 0);
}

erros by this one ..

Quote:

C:\Users\Eigenaar\Desktop\SAMP\gamemodes\VortexRol eplay.pwn(12744) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Eigenaar\Desktop\SAMP\gamemodes\VortexRol eplay.pwn(12744) : error 017: undefined symbol "string"
C:\Users\Eigenaar\Desktop\SAMP\gamemodes\VortexRol eplay.pwn(12744) : error 001: expected token: ";", but found "]"
C:\Users\Eigenaar\Desktop\SAMP\gamemodes\VortexRol eplay.pwn(12744) : fatal error 107: too many error messages on one line

Reply
#4

Help?
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=300443 Why?

pawn Код:
CMD:pdhim(playerid, params[])
{
    new string[128], target, aName[24];
    if(Player[playerid][Tester] < 1) return 0;
    if(sscanf(params,"d",target)) return SendClientMessage(playerid,-1,"SYNTAX: /pdhim [ID]");
    if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"Invalid Player ID!");
    GetPlayerName(playerid,aName,24);
    format(string, sizeof(string), "HELPER %s teleported you to the police department LS", aName);
    SendClientMessage(target, RED, string);
    SetPlayerPos(target, 1551.8000488281, 1670.4000244141,0.0);//add here Z co-ordinate
    SetPlayerInterior(target, SpawnInt);
    SetPlayerVirtualWorld(target, 0);
    return 1;
}

CMD:fixvw(playerid, params[])
{
    new string[128], target, pname[24];
    if(Player[playerid][Tester] < 1) return 0;
    if(sscanf(params,"d",target)) return SendClientMessage(playerid,-1,"SYNTAX: /fixvw [ID]");
    if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"Invalid Player ID!");
    GetPlayerName(playerid, pname, sizeof(pname));
    SetPlayerVirtualWorld(target, 0);
    format(string, sizeof(string), "HELPER %s has fixed your virtual world", pname);
    SendClientMessage(playerid, RED, string);
    return 1;
}
Here.

NOTE: UNTESTED!
Reply
#6

I use your thing and i get tped to LV airport I GOT RIGHT COORDINATES!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)